#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
using namespace std;
const int N = 50;
int n, m;
int f[N][N];
int main()
{
    cin >> n >> m;
    f[0][1] = 1;
    for (int i = 1; i <= m; i++)
    {
        f[i][1] = f[i - 1][2] + f[i - 1][n];
        for (int j = 2; j < n; j++)
        {
            f[i][j] = f[i - 1][j - 1] + f[i - 1][j + 1];
        }
        f[i][n] = f[i - 1][1] + f[i - 1][n - 1];
    }
    cout << f[m][1] << endl;
    return 0;
}